/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.openbravo.data.loader;

public abstract class QBFCompareEnum {

	public static final QBFCompareEnum COMP_NONE = new QBFCompareEnum(0,
			"qbf.none") {

		public String getExpression(String s, String s1) {
			return null;
		}

	};
	public static final QBFCompareEnum COMP_ISNULL = new QBFCompareEnum(1,
			"qbf.null") {

		public String getExpression(String s, String s1) {
			return (new StringBuilder()).append(s).append(" IS NULL")
					.toString();
		}

	};
	public static final QBFCompareEnum COMP_ISNOTNULL = new QBFCompareEnum(2,
			"qbf.notnull") {

		public String getExpression(String s, String s1) {
			return (new StringBuilder()).append(s).append(" IS NOT NULL")
					.toString();
		}

	};
	public static final QBFCompareEnum COMP_RE = new QBFCompareEnum(3, "qbf.re") {

		public String getExpression(String s, String s1) {
			return (new StringBuilder()).append(s).append(" LIKE ").append(s1)
					.toString();
		}

	};
	public static final QBFCompareEnum COMP_EQUALS = new QBFCompareEnum(3,
			"qbf.equals") {

		public String getExpression(String s, String s1) {
			return (new StringBuilder()).append(s).append(" = ").append(s1)
					.toString();
		}

	};
	public static final QBFCompareEnum COMP_DISTINCT = new QBFCompareEnum(4,
			"qbf.distinct") {

		public String getExpression(String s, String s1) {
			return (new StringBuilder()).append(s).append(" <> ").append(s1)
					.toString();
		}

	};
	public static final QBFCompareEnum COMP_GREATER = new QBFCompareEnum(5,
			"qbf.greater") {

		public String getExpression(String s, String s1) {
			return (new StringBuilder()).append(s).append(" > ").append(s1)
					.toString();
		}

	};
	public static final QBFCompareEnum COMP_LESS = new QBFCompareEnum(6,
			"qbf.less") {

		public String getExpression(String s, String s1) {
			return (new StringBuilder()).append(s).append(" < ").append(s1)
					.toString();
		}

	};
	public static final QBFCompareEnum COMP_GREATEROREQUALS = new QBFCompareEnum(
			7, "qbf.greaterequals") {

		public String getExpression(String s, String s1) {
			return (new StringBuilder()).append(s).append(" >= ").append(s1)
					.toString();
		}

	};
	public static final QBFCompareEnum COMP_LESSOREQUALS = new QBFCompareEnum(
			8, "qbf.lessequals") {

		public String getExpression(String s, String s1) {
			return (new StringBuilder()).append(s).append(" <= ").append(s1)
					.toString();
		}

	};
	private int m_iValue;
	private String m_sKey;

	private QBFCompareEnum(int i, String s) {
		m_iValue = i;
		m_sKey = s;
	}

	public int getCompareInt() {
		return m_iValue;
	}

	public String toString() {
		return LocalRes.getIntString(m_sKey);
	}

	public abstract String getExpression(String s, String s1);

}
